package com.lapula.crazyface;

import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.PopupWindow;

public class PreviewPopupWindow extends PopupWindow {

	public PreviewPopupWindow(final Activity context) {
		super(context);
		
		LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View mMenuView = inflater.inflate(R.layout.popup_window, null);
		this.setContentView(mMenuView);
		this.setWidth(LayoutParams.MATCH_PARENT);
		this.setHeight(LayoutParams.WRAP_CONTENT);
		this.setFocusable(true);
		this.setAnimationStyle(R.style.AnimBottom);
		this.setBackgroundDrawable(new ColorDrawable(0xb0000000));
		
		mMenuView.findViewById(R.id.btn_redo).setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				context.finish();
			} 
		});
		
		mMenuView.findViewById(R.id.btn_cancel).setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				dismiss();
			} 
		});
	}
}
